import axiosRequest from "@/api/axiosRequest.ts";

const BaseUrl = '/category'

const getCategoryDetail = (id:number) => axiosRequest({
    url:BaseUrl + '/detail' ,
    method: 'GET',
    params: {
        id: id
    }
})

const getCategoryPage = (page:number=1, pageSize?:number,type?: number) => axiosRequest({
    url: BaseUrl + '/page',
    method: 'GET',
    params: {
        current: page,
        size: pageSize,
        type: type
    }
})

export const categoryApi = {
    getCategoryList : () => axiosRequest.get(BaseUrl + '/list'),
    getCategoryTree : () => axiosRequest.get(BaseUrl + '/tree'),
    getCategoryDetail,
    getCategoryPage
}
